<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="/css/easyui.css">
    <link rel="stylesheet" type="text/css" href="/css/icon.css">
    <style type="text/css">
        .ff label{
            display:block;
            width:100px;
        }
    </style>
    <script type="text/javascript" src="/js/jquery-1.6.1.min.js"></script>
    <script type="text/javascript" src="/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/js/easyui-lang-zh_CN.js"></script>

    <script type="text/javascript" src="/js/HttpClient.js"></script>

    <script type="text/javascript" src="/js/validate-fx.js"></script>
    <script type="text/javascript">
        // Validfx.debug = true;
        // Validfx.bindVoAttr = ":bindVo";
        function register() {
            $(event.target).submitData({
                url:"/users/register",
                success: function (resp) {
                    console.log(resp);
                }
            });
        }
        function login() {
            $(event.target).submitData({
                url:"/users/login",
                success: function (resp) {
                    console.log(resp);
                }
            });
        }
        $(function () {
            // 加载测试数据
            $("#ff").form('load', '/users/测试用户信息');
        });

        Validfx.onFormValidFail = function (context) {
            console.log(context.form,"onFormValidFail.form");
            console.log(context.items,"onFormValidFail.items");
        };
    </script>
</head>
<body>
<div style="width:230px;background:#fafafa;padding:10px;">
    <div style="padding:3px 2px;border-bottom:1px solid #ccc">用户注册</div>
    <form id="ff" method="post" class="ff" bindVo="user">
        <div>
            <label for="field_userId">用户名:</label>
            <input id="field_userId" class="easyui-validatebox" type="text" name="userId"></input>
        </div>
        <div>
            <label for="field_email">Email:</label>
            <input id="field_email" class="easyui-validatebox" type="text" name="email"></input>
        </div>
        <div>
            <label for="field_mobile">手机:</label>
            <input id="field_mobile" class="easyui-validatebox" type="text" name="phone"></input>
        </div>
        <div>
            <label for="field_zipCode">邮政编码:</label>
            <input id="field_zipCode" class="easyui-validatebox" type="text" name="zipCode"></input>
        </div>
        <div>
            <label for="field_hobbies1" name="group_hobbies">爱好（多选）:</label>
            <input id="field_hobbies1" class="easyui-validatebox" type="checkbox" value="运动" name="hobbies"/>运动</input>
            <input id="field_hobbies2" class="easyui-validatebox" type="checkbox" value="音乐" name="hobbies"/>音乐</input>
            <input id="field_hobbies3" class="easyui-validatebox" type="checkbox" value="绘画" name="hobbies"/>绘画</input>
            <input id="field_hobbies4" class="easyui-validatebox" type="checkbox" value="舞蹈" name="hobbies"/>舞蹈</input>
        </div>
        <div>
            <label for="field_gender1">性别（单选）:</label>
            <input id="field_gender1" class="easyui-validatebox" type="radio" value="男" name="gender"/>男</input>
            <input id="field_gender2" class="easyui-validatebox" type="radio" value="女" name="gender"/>女</input>
            <input id="field_gender3" class="easyui-validatebox" type="radio" value="保密" name="gender"/>保密</input>
        </div>

        <div>
            <input type="button" onclick="javascript:register();" value="保存">
        </div>
    </form>

</div>
<div style="width:230px;background:#fafafa;padding:10px;">
    <form  method="post" class="ff" bindVo="loginUser">
        <div>
            <label for="field_userId2">用户名:</label>
            <input id="field_userId2" class="easyui-validatebox" type="text" name="userId"></input>
        </div>
        <div>
            <label for="field_password">密码:</label>
            <input id="field_password" class="easyui-validatebox" type="password" name="password"></input>
        </div>
        <div>
            <label for="field_repwd">确认密码:</label>
            <input id="field_repwd" class="easyui-validatebox" type="password" name="repwd" required="true" validType="equals['#field_password','确认密码和密码不一致']"></input>
        </div>

        <div>
            <input type="button" onclick="javascript:login();" value="登录">
        </div>
    </form>
</div>


</body>
</html>